<%@ page language="java" import="java.util.*" pageEncoding="Utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>点评</title>

<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/qdh.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/member.css" type="text/css" media="screen" />
<script type="text/javascript" src="${pageContext.request.contextPath}/common/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
	function saveComment(){
		if($(".starbox input:checked").size( )==0){
			$("#commentmsg").html("评价不能为空");
			return false;
		}
		else{
		$("#commentmsg").html("");
		}
		 if($("#remark").val().length<5){
			$("#remarkmsg").html("评价内容不能少于5个字");
			return false;
		}
		else{
		$("#remarkmsg").html("");
		}
		if($(".starbox input:checked").size( )!=0&&$("#remark").val().length>=5){
		$.ajax({
			dataType:'json',
			type:'post',
			url:'checkReview.action',
			data:'id='+$("#fromId").val(),
			success:function(data){
				if(data.success){
					$("#form").submit();
				}
				else{
				alert("您已点评，请勿重复点评");
				}
			}	
		});		
		}	
	}
</script>
</head>
<body>
<div id="wrap">
	<s:include value="header.jsp"/>
	<div id="container">
		<div class="fl membersiderbox">
			<h1>用户中心</h1>
			<div class="mleft">
				<s:include value="mleft.jsp"/>
			</div>
		</div>
		<div class="fr membermain">
			<form id="form" method="post" action="sureReview.action">
				<input type="hidden" id="fromId" name="review.orderId" value=<%=request.getParameter("id") %>>			
				<div class="blockbox1" id="review">
					<span class="blocktitle">用户点评</span>
					<div class="blockboxdetail">
						<div class="commentbox">
							<div class="commenttop1">
								<div class="fl starbox">
									<ul>
										<li><label><input type="radio"  name="review.comment" value="1"><img src="${pageContext.request.contextPath}/common/image/ping1.gif"/></label></li>
										<li><label><input type="radio"  name="review.comment" value="2"><img src="${pageContext.request.contextPath}/common/image/ping0.gif"/></label></li>
										<li><label><input type="radio"  name="review.comment" value="3"><img src="${pageContext.request.contextPath}/common/image/ping-1.gif"/></label></li>
									</ul>
									<span id="commentmsg" style="margin-left:-100px;color:red"></span>
								</div>
							</div>
							<div class="commentform">
								<h1>点评内容：</h1>
								<div class="commenttextarea2"><textarea name="review.remark" id="remark" class="ordertxt"></textarea></div>																
								<div class="commentbtns">
									<span class="fl t1">请自觉遵守互联网相关的政策法规，严禁发布色情、暴力、反动的言论。</span>
									<span class="fr"><span id="remarkmsg" style="color:red"></span><input type="button"  onclick="saveComment();" class="commentbtn" /></span>
								</div>
							</div>
						</div>		
					</div>	
				</div>					
			</form>						
		</div>
		<div class="clr"></div>
	</div>
	<s:include value="../footer.htm"/>
</div>
</body>
</html>
